package com.dong.controller;

import com.dong.service.StockService_redisson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: distinct-lock
 * @description:
 * @author: cc
 **/
@RestController
public class StockController {

    @Autowired
    private StockService_redisson stockService;

    //根据商品编号减库存
    @GetMapping("/incr/{productid}")
    public String incr(@PathVariable Integer productid){
         return stockService.decrement(productid);
    }
}
